<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

<title>订单列表</title>

<meta name="description" content="">
<meta name="keyword" content="关键字1，关键字2，—">

</head>
<!-- end header -->
<body>
  <div class="page-group">
    <div class="page page-current moyu-page" style="background-color: #F8F8F8;">
      <header class="bar bar-nav shop-header">
        <h1 class="title">订单列表</h1>
      </header>

      <div class="content" style="background-color: #F8F8F8;">
        <c:forEach var="order" items="${orders}">
          <c:if test="${!order.disabled}">
            <c:if test="${order.orderStatus != 'CREATED'}">
            <a href="${ctx.host}/moyu/orders/${order.id}" style="display: block; color: unset !important;">
            <div class="card">
              <div class="card-header" style="">
                <span class="color-${order.orderStatus.css}">${order.orderStatus.description}</span>
              </div>
              <div class="card-content">
                <div class="list-block media-list">
                  <ul>
                    <li class="item-content">
                      <div class="item-media">
                        <img src="${ctx.resource}/image/moyu/moyu-1.jpeg" width="44">
                      </div>
                      <div class="item-inner">
                        <div class="item-title-row">
                          <div class="item-title">人马君 乐在美味即食魔芋拌面（肽+） 轻卡低热量 减脂餐 魔芋面主食品方便即食速食</div>
                        </div>
                        <div class="item-subtitle">
                          <c:choose>
                            <c:when test="${order.type == 1}">
                          香辣钵钵鸡味6盒
                        </c:when>
                            <c:when test="${order.type == 2}">
                          葱油鸡汁味6盒
                        </c:when>
                            <c:when test="${param.type == 3}">
                          香辣钵钵鸡味3盒+葱油鸡汁味3盒
                        </c:when>
                            <c:otherwise>

                            </c:otherwise>
                          </c:choose>
                        </div>
                        <div class="item-subtitle clearfix">
                          <p class="pull-left single-price">
                            <span>￥</span>118
                          </p>
                          <p class="pull-right amount">
                            <span>x</span>${order.amount}
                          </p>
                        </div>
                      </div>
                    </li>
                  </ul>
                </div>
              </div>
              <div class="card-footer">
                <div></div>
                <div>
                  <span class="total-amount">共${order.amount}件</span> <span>商品小计：<span class="price-symbol">￥<span class="price"> <fmt:formatNumber value="${order.price/100}" pattern="00.00"></fmt:formatNumber>
                    </span></span></span>
                </div>
              </div>
            </div>
            </a>
            </c:if>
          </c:if>
        </c:forEach>

      </div>
      <!-- End Content -->

    </div>
  </div>


  <%@ include file="/WEB-INF/include/script.jsp"%>
<d:resource type="script" root="${ctx.resource}/build" src="js/page/product/moyu-order.js" />
  <script type="text/javascript">
      var jsConfig = JSON.parse('${wechatJsConfig}')
      require(['page/product/moyu-order'], function(page) {
        page.init({
          jsConfig: jsConfig
        })
      })
    </script>
</body>
</html>